import React from 'react';
import { useAuth } from '@/hooks/useAuth';

const AuthButton: React.FC<{ permission?: string[], children: React.ReactNode }> = ({ permission, children }) => {
    const { permissions } = useAuth();

    if (!permissions.some((item:any)=>permission?.includes(item))) {
        return null;
    }

    return <>{children}</>;
};

export default AuthButton;
